-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add CALIB
and wcsinfo to ami schema
#357
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #357 +/- ##
==========================================
+ Coverage 67.52% 67.56% +0.03%
==========================================
Files 114 114
Lines 5916 5920 +4
==========================================
+ Hits 3995 4000 +5
+ Misses 1921 1920 -1 ☔ View full report in Codecov by Sentry. |
I was looking at this again and realized that the 'PA' quantity is in the input datamodel as meta.aperture.position_angle, but that isn't carried into the output AmiOiModel, I'm guessing because it's not in the primary extension? I would also guess it's not best practice to have the same value defined as two different keywords in the dictionary, so I'm wondering if there's a better way to include it in the schema for oifits files? |
I converted this back to draft until the details of |
Thanks for giving this another look. Does PA_APER (at |
I think 'meta.pointing.pa_v3' from the calints file (FITS keyword PA_V3) is actually the one we want. There are a few similar values in the header but that's what we've been using. If it's not too much trouble, let's also add 'meta.wcsinfo.v3yangle' (FITS keyword V3I_YANG) because we use that as well. The original reason for defining the separate PA keyword was because we actually use an angle of |
It sounds like referencing and using the keywords defined in wcsinfo:
How about we pair this PR with yours on jwst: spacetelescope/jwst#8846 by changing the stdatamodels dependency in the pyproject.toml in your PR to point to the source branch for this PR?
That way the CI and regtests will pick up the changes in this PR when testing your PR. If you run into issues where a keyword isn't available I can add it and push to this PR. Once they're both ready we can open them for review with a note that this PR will have to be merged first and then your jwst PR updated to point back to stdatamodels main. |
As far as I am aware right now, those keywords defined in wcsinfo should be sufficient to add to the output AmiOiModel. I also don't see any conflicting keywords in the OIFITS standard or this document that describes more standardized keywords, including some WCS ones. I just pushed the modified pyproject.toml file on my jwst PR so hopefully we can get the remaining failing tests to pass. |
Thanks! I updated the schema to contain wcsinfo. It may require some updates to the jwst code to copy the data over from the input to the output files. Let me know what updates would be helpful for this PR and if there's anything I can do to help with the jwst one. |
Thanks! I made some updates to carry the wcsinfo through to the output file, and that seems to be working fine, as is the calibrator_object_id in the calibrated products. I also tested the code using the wcsinfo.roll_ref keyword in place of the pointing.pa_v3 and the end product was still good. Out of curiosity, is it possible to add individual keywords from other schemas, or does it have to be a whole schema (the way you added wcsinfo to the new ami schema)? |
From my end I think we're good to merge this so we can move forward with getting the JWST PR(s) ready to merge as well. |
CALIB
and wcsinfo to ami schema
Hi Brett, when Melanie ran the reg tests for spacetelescope/jwst#8846 she found that the oi.fits products now contain the SCI extension, which they shouldn't. I'm guessing it's because we're now copying the wcsinfo over, and that is associated with the SCI extension of the input. Is there a way of just taking the header keywords without the data part of the HDU? |
The inclusion of the
What's the issue with including the SCI extension? The oifits standard doesn't exclude additional extensions and running one of the files output during the run you linked:https://bytesalad.stsci.edu/ui/native/jwst-pipeline-results/2024-11-22_GITHUB_CI_Linux-X64-py3.12-1027/2686_test_niriss_ami3_exp/jw01093012001_03102_00001_nis_a3002_ami-oi.fits through the oifits checker results in a "pass":
Also, in that file the
Are there other files where the |
I guess there isn't technically an issue, it just seemed odd to have an extension with no data that doesn't really serve a purpose other than having the header keywords, especially since the 'SCI' extension in all the other pipeline product levels does contain the science data. If there's no way around it we can deal with it. |
After a little more consideration I think this tips the balance back in favor of using the 'PA' keyword we initially defined. Since the JWST keyword dictionary includes how it is derived, I don't think it's unreasonable or too confusing to include it despite its similarity to other keywords. |
Thanks. We could put Perhaps @tapastro or @melanieclarke can weight in on this. I'm in favor of keeping consistency for keywords that are shared with other data products. |
If we go down that route, what other keywords from |
I am in favor of keeping keywords names and definitions consistent wherever possible, but I don't see any reason why they should always have to live in the same extension, especially if you have to make a whole new extension just to store them! From a FITS user perspective, it's very confusing to have to access an empty image extension to get keywords that are actually relevant to other extensions. I think it makes sense to copy the definition for the keywords needed from the wcsinfo schema, but change the HDU requirement to one that's already present in the data. |
I think if we can copy the names and definitions of just the few keywords we need from wcsinfo into the ami.schema that would be ideal. That way we won't have the potentially confusing empty SCI extension or the additional keyword(s) used only for AMI with similar definitions to existing ones. We should just need |
Thanks. Is These changes will require updates to the keyword dictionary since none of those keywords are currently defined in the
To provide an example |
That's right, after some discussion on our team we decided we should use
I see, so there will essentially be duplicate entries in the keyword dictionary but with different paths. If possible I think it makes sense to put them in the same place as the other AMI-specific keywords. In the tree it looks like that's To fill out the blanks in the table:
|
Thanks! Good to know.
Since these aren't required or used by oifits how about putting them under That would make the table:
|
Sure, that makes a lot of sense.
Yep, we do still need |
Thanks! I think we have an updated "game plan" now. I'll stick with
|
@rcooper295 The updates have been made to this PR. Let me know if there's anything else you need. |
Thanks so much! I was able to make the changes in my code to use the updates and check that everything worked as expected, so I'm good with this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
I reran the regtests (same link as above). All failures are unrelated so merging. |
Required for spacetelescope/jwst#8846
This PR adds the
CALIB
keyword and wcsinfo subschema to theAmiOIModel
schema.Regression tests running at https://github.com/spacetelescope/RegressionTests/actions/runs/11978383053
Tasks
docs/
pageno-changelog-entry-needed
)changes/
:echo "changed something" > changes/<PR#>.<changetype>.rst
(see below for change types)jwst
regression tests with this branch installed ("git+https://github.com/<fork>/stdatamodels@<branch>"
)news fragment change types...
changes/<PR#>.feature.rst
: new featurechanges/<PR#>.bugfix.rst
: fixes an issuechanges/<PR#>.doc.rst
: documentation changechanges/<PR#>.removal.rst
: deprecation or removal of public APIchanges/<PR#>.misc.rst
: infrastructure or miscellaneous change